package com.microservice.salmon.service.exception;

import com.salmon.common.ApiResponse;

/**
 * <p>
 * 资源服务通用异常处理类
 * </p>
 *
 * @author 王洪庆 2019-01-14 17:03
 */
public class ResourceException extends RuntimeException {
    private int code;

    public ResourceException(ApiResponse.Status status) {
        this(status.getCode(), status.getStandardMessage());
    }

    public ResourceException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
